package com.itlong.cloud.noncore.operate;

import com.itlong.cloud.POJO.DTO.operate.OperateAppFunctionGetPageDTO;
import com.itlong.cloud.POJO.PO.AppFunctionInfoPO;
import com.itlong.cloud.POJO.VO.app.AppFunctionInfoVO;
import com.itlong.cloud.utils.page.Page;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * <desc>
 *      运营-APP-功能管理业务处理暴露接口
 * </desc>
 *
 * @createDate 2017/09/29
 */
@FeignClient("non-core-service")
public interface IOperateAppFunctionInfoServiceClient {
    /**
     * <desc>
     *      保存功能
     * </desc>
     *
     * @param appFunctionInfoPO 功能实体
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/operate/appManage/function/save")
    Integer save(@RequestBody AppFunctionInfoPO appFunctionInfoPO) throws Exception;

    /**
     * <desc>
     *      更新功能
     * </desc>
     *
     * @param appFunctionInfoPO 功能实体
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/operate/appManage/function/update")
    Integer update(@RequestBody AppFunctionInfoPO appFunctionInfoPO) throws Exception;

    /**
     * <desc>
     *      通过id获取功能
     * </desc>
     *
     * @param appFunctionInfoPO 功能实体
     * @return 资源实体
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/operate/appManage/function/getOne")
    AppFunctionInfoPO getOne(@RequestBody AppFunctionInfoPO appFunctionInfoPO);


    /**
     * <desc>
     *      获取分页数据
     * </desc>
     *
     * @param pageDTO 查询参数DTO
     * @return page模型
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/operate/appManage/function/getPage")
    Page<AppFunctionInfoPO> getPage(@RequestBody OperateAppFunctionGetPageDTO pageDTO) throws Exception;

    /**
     * <desc>
     *      删除功能
     * </desc>
     *
     * @param appFunctionIds 功能id数组
     * @return sql执行行数
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/operate/appManage/function/delete")
    Integer delete(@RequestParam("appFunctionIds")String appFunctionIds);

    /**
     * <desc>
     *      获取子节点
     * </desc>
     *
     * @param appFunctionId 资源id
     * @return 子级结果集
     * @author Jiaqi.X
     * @createDate 2017/09/21
     */
    @RequestMapping(path = "/operate/appManage/function/getChilds")
    List<AppFunctionInfoVO> getChilds(@RequestParam("appFunctionId")String appFunctionId);


    /**
     * <desc>
     *      获取分配菜单所有节点
     * </desc>
     *
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/26
     */
    @RequestMapping(path = "/operate/appManage/function/getAllotFunction")
    List<AppFunctionInfoVO> getAllotFunction(@RequestParam("appPackageId")String appPackageId);

    /**
     * <desc>
     *      获取当前节点的父级节点以及同级别所有父级节点
     * </desc>
     *
     * @param parent 资源id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/09/30
     */
    @RequestMapping(path = "/operate/appManage/function/getParentLevelFunctions")
    List<AppFunctionInfoPO> getParentLevelFunctions(@RequestParam("parent")String parent);


    /**
     * <desc>
     *      获取APP配置信息 供APP使用
     * </desc>
     *
     * @param projectId 项目id
     * @return
     * @author Jiaqi.X
     * @createDate 2017/11/02
     */
    @RequestMapping(path = "/operate/appManage/function/getAppConfig")
    List<AppFunctionInfoPO> getAppConfig(@RequestParam("projectId")String projectId);

    /**
     * <desc>
     *      云半径多场景项目上线后处理旧数据
     * </desc>
     *
     * @param
     * @return
     * @Author Zhu.yj
     * @createDate  2021/5/12
     */
    @PostMapping("/handlerOldPackage")
    Integer handlerOldPackage();
}
